<template>
	<view>
		<view v-if="myInvoice && myInvoice.length">
			<view class="invoice" v-for="(item,index) in myInvoice" :key='index'>
				<text class="invoice_code">订单编号：{{item.orderNo}}</text>
				<view class="invoice_record" @click="invoiceEvent(item)">
					查看开票记录
				</view>
			</view>
		</view>
		<view v-else style="text-align: center;margin-top: 55%;font-size: 28rpx;">
			<text>暂无开票记录...</text>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				myInvoice:[]
			}
		},
		onLoad() {
			let self = this;
			self._get('user/index/invoiceGroupByOrder', {}, function(res) {
				const { data } = res;
				self.myInvoice = data;
			});
			
		},
		
		methods:{
			invoiceEvent(item){
				console.log(item);
				uni.navigateTo({
					url:'/userpage/userinfo/InvoiceList?orderId='+item.orderId
				})
			}
		}
	}
</script>

<style lang="less">
	page{
		background: #F9F9F9;
	}
	.invoice{
		background-color: #FFFFFF;
		padding: 20rpx 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 20rpx;
		&_code{
			// width: 446px;
			// height: 40px;
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #333333;
			line-height: 40rpx;

		}
		&_record{
			width: 196rpx;
			height: 60rpx;
			background: #077840;
			border-radius: 8rpx;

			// width: 156rpx;
			// height: 36rpx;
			text-align: center;
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
			line-height: 60rpx;

		}
	}
</style>
